﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

using Qiang.Data;
using Qiang.Styles;


namespace Qiang.Controls
{
    public class MapImageLayer : ImageLayer,IMapImageLayer
    {

        /// <summary>
        /// 用于Map控件显示的位图图层
        /// </summary>
        /// <param name="dataset"></param>
        public MapImageLayer(IImageDataset dataset)
            : base(dataset)
        {
 
        }
               

        public void DrawRegion(MapDrawArgs args, IExtent region)
        {
            Graphics g = args.MapGraphics;

            Bitmap map=this .Dataset .GetBitmap(region,args.MapRectangle);

            if (map != null)
            {
                g.DrawImage(map, args.MapRectangle);
                map.Dispose();
            }

        }



    }
}
